PNMTOLJPG(1) PNMTOLJPG(1) NAME pnmtoljpg - compress a Portable Pixmap or Portable Graymap image file to a lossless JPEG file SYNOPSIS pnmtoljpg [ -d ] [ -h ] [ -p# ] [ -r# ] [ -s{1..7} ] [ -v ] [ filename ... ] DESCRIPTION pnmtoljpg compresses a PPM (Portable Pixmap) or a PGM (Portable Graymap) image, and produces a lossless JPEG (LJPG) file. If no files are specified, the standard input is compressed to the standard output. OPTIONS -d Use default Huffman table. If this flag is not specified, pnmtoljpg will generate an optimal Huff- man table. -h --help Display a help screen and quit. -p# The #, an integer less than sample precision bits, is the point tranform parameter. -r# Restart at every # row(s). -s{1..7} Supply a prediction selection value (PSV) set, {1..7}. The pnmtoljpg tries all PSVs in the set and select the best one. A PSV is an integer between 1 and 7 inclusively. If a "-s" flag is not provided, pnmtoljpg will try all seven PSVs. -v verbose Display data about image format, image size, sample precision, total bytes category symbols, total bytes of additional symbols, original and com- pressed file size, and compress ratio. EXAMPLES This example compresses a PPM file foo.ppm with optimal Huffman table and the default PSV set. The output is foo.ljpg. pnmtoljpg foo.ppm foo.ljpg Next example compresses a PGM file foo.pgm with default Huffman table and PSV 4. The output is saved as foo.ljpg. pnmtoljpg -d -s4 < foo.ppm > foo.ljpg The last example compresses a PPM file foo.ppm with 14 June 1994 1 PNMTOLJPG(1) PNMTOLJPG(1) optimal Huffman table and a PSV set {246}. The verbose flag is on, and the output is saved as foo.ljpg. pnmtoljpg -v -s246 foo.ppm > foo.ljpg SEE ALSO ljpgtopnm(1), ppm(5), pgm(5) Wallace, Gregory K. "The JPEG Still Picture Compression Standard", Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44. AUTHOR Kongji Huang and Brian Smith BUGS Arithmetic coding and multiple scans are not supported. Comments in PPM/PGM files are not stored in the LJPG files. 14 June 1994 2